﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Nage.Algorithms;
using Nage.Algorithms.Solution;

namespace Nage.Examples.Rastrigin.Solution
{
    public class Coordinates : ISolution
    {
        #region Public properties
        /// <summary>
        /// X coordinate
        /// </summary>
        public double X { get; set; }
        /// <summary>
        /// Y coordinate
        /// </summary>
        public double Y { get; set; }
        /// <summary>
        /// Fitness
        /// </summary>
        public double Fitness { get; set; }
        #endregion

        #region Constructors
        public Coordinates()
        {
        }

        public Coordinates(double x, double y)
        {
            this.X = x;
            this.Y = y;
        } 
        #endregion

        #region GetRepresentation
        public object GetRepresentation()
        {
            return new double[] { X, Y };
        } 
        #endregion

        #region ToString
        public override string ToString()
        {
            return String.Format("( {0} ; {1} )", X.ToString("0.00000"), Y.ToString("0.00000"));
        } 
        #endregion
    }
}
